#include "receive_processor.h"
#include<QDebug>

Receive_Processor::Receive_Processor(QList<QList<int> *>*Register_location,
                           QList<QString> *Code_type,
                           QList<double> *Coefficient_list,
                           QList<QString> *Unit_list,
                           QList<QString> *Annotation_list,
                           QList<QString> *Db_type_list,
                             QList<QString> *Param_db_name,
                             QList<double> *Param_top_value,
                            QString Address,
                           QObject *parent)
    :register_location(Register_location),
    code_type(Code_type),
    coefficient_list(Coefficient_list),
    unit_list(Unit_list),
    annotation_list(Annotation_list),
    db_type_list(Db_type_list),
    top_value_list(Param_top_value),
    address(Address),
    param_db_name(Param_db_name),
    QObject{parent}
{
    real_value_list=new QList<double>;
}

///处理数据
void Receive_Processor::Process_data()
{

}


int Receive_Processor::hexQCharToInt(const QChar &c) {
    ushort code = c.unicode();
    if (code >= '0' && code <= '9') {
        return code - '0';          // 处理数字
    } else if (code >= 'A' && code <= 'F') {
        return 10 + (code - 'A');  // 处理大写字母
    } else if (code >= 'a' && code <= 'f') {
        return 10 + (code - 'a');  // 处理小写字母
    }
    return -1; // 无效字符返回-1
}

